<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>系统公告</title>
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/style.css" />
		<style>
			.mui-bar-nav {
				background: #27CDDB;
			}
			
			.mui-action-back,
			.mui-title,
			.mui-action-back:active {
				color: #FFFFFF;
			}
			
			p {
				padding: 5px 8px;
			}
			
			html,
			body,
			.mui-content {
				background-color: #fff;
			}
			
			h4 {
				margin-left: 5px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">公告</h1>
		</header>
		<div class="mui-content" id="aicVue">
			<div class="mui-content-padded">
				<p class="dark-medium" v-html="content"></p>
			</div>
			<div>
				<span class="dark-small" style="float: right;margin-right: 5px;">{{createTime}}</span>
			</div>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script type="text/javascript" src="../js/vue.min.js"></script>
	<script type="text/javascript" src="../js/public.js"></script>
	<script type="text/javascript">
		mui.init()
		var noticeId;

		var vm = new Vue({
			el: '#aicVue',
			data: {
				content: "",
				createTime: ""
			},
			mounted: function() {
				mui.plusReady(function() {
					swipeBack();
					//给detailPage赋值,根据ID获取详情页面
					noticeId = plus.webview.currentWebview().noticeId;
					vm.getNoticeDetail();
				});
			},
			methods: {
				getNoticeDetail: function() {
					var mdata = {
						"id": noticeId
					};
					mui.postParam(GetNoticeDetail, mdata, function(result) {
						mConsole.log("公告详情：" + JSON.stringify(result));
						if(result.code == 0) {
							if(result.notice.content && result.notice.content.length > 0) {
								vm.content = result.notice.content.replace(/(\r\n)|(\n)/g,'<br/>').replace(/ /g,'&nbsp;');;
							}
							vm.createTime = result.notice.createTime;
							mui(".mui-title")[0].innerText = result.notice.title;
							return;
						}
						mymui(result.msg);
					});
				}
			}
		});
	</script>

</html>